n, m = map(int, input().split())
edges = [[] for _ in range(n+1)]
for _ in range(m):
    u, v = map(int, input().split())
    edges[u].append(v)
    edges[v].append(u)

dp = [1 for _ in range(n+1)]